home *** CD-ROM | disk | FTP | other *** search
/ Digital Information Mana…ntial Guide to Multimedia / Digital Information Management - An Essential Guide to Multimedia.iso / Audacity / Nyquist / profile.lsp < prev    next >
Lisp/Scheme  |  2006-05-16  |  814b  |  28 lines

  1.  
  2. ; profile.lsp -- support for profiling
  3.  
  4. ;## show-profile -- print profile data
  5. (defun show-profile ()
  6.   (let ((profile-flag (profile nil)) (total 0))
  7.     (dolist (name *PROFILE*)
  8.             (setq total (+ total (get name '*PROFILE*))))
  9.     (dolist (name *PROFILE*)
  10.             (format t "~A (~A%): ~A~%"
  11.                     (get name '*PROFILE*)
  12.                     (truncate
  13.                      (+ 0.5 (/ (float (* 100 (get name '*PROFILE*)))
  14.                                total)))
  15.                     name))
  16.     (format t "Total: ~A~%" total)
  17.     (profile profile-flag)))
  18.  
  19.  
  20. ;## start-profile -- clear old profile data and start profiling
  21. (defun start-profile ()
  22.   (profile nil)
  23.   (dolist (name *PROFILE*)
  24.           (remprop name '*PROFILE*))
  25.   (setq *PROFILE* nil)
  26.   (profile t))
  27.  
  28.